﻿List<Data> db_list = new List<Data>();//100000
List<Data> new_list = new List<Data>();//100000
Random random = new Random();
DateTime time = Convert.ToDateTime("2025-01-01 00:00:00");
Console.WriteLine(DateTime.Now);
for (int i = 0; i < 100000; i++)
{
    int min = random.Next(200000);
    db_list.Add(new Data() { Time = time.AddMinutes(i), Value = random.Next(100) });
    new_list.Add(new Data() { Time = time.AddMinutes(min), Value = random.Next(100) });
}
Console.WriteLine(DateTime.Now);
Dictionary<string, Data> db_dict = db_list.ToDictionary(t => t.Time.ToString("yyyyMMddHHmmss"), t => t);
Dictionary<string, Data> new_dict = new_list.DistinctBy(t=>t.Time).ToDictionary(t => t.Time.ToString("yyyyMMddHHmmss"), t => t);

Console.WriteLine(DateTime.Now);
class Data
{
    public DateTime Time { get; set; }
    public int Value { get; set; }
}
